package com.itfreer.esb.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.itfreer.esb.proxy.entity.ProxyAdressEntity;
import com.itfreer.esb.proxy.entity.ProxyBlackEntity;
import com.itfreer.form.api.JdbcBaseEntity;

/**
 * 代理黑名单信息
 * @author gj
 *
 */
@Entity(name = "esb_proxy_black")
@Table(indexes = { @Index(name = "esb_proxy_black_server", columnList = "s_server")
,@Index(name = "esb_proxy_black_black", columnList = "s_black")})
public class JdbcProxyBlackEntity  implements JdbcBaseEntity<ProxyBlackEntity>, Serializable { 
	private static final long serialVersionUID = 4673423560339517162L;
	
	/**
	 * 主键
	 */
	@Id
	@Column(name = "s_id", length = 200, nullable = false)
	private String id;
	
	/**
	 * 服务
	 */
	@Column(name = "s_server")
	private String server;
	
	
	/**
	 * 黑名单
	 */
	@Column(name = "s_black")
	private String black;
	
	
	/**
	 * 创建时间
	 */
	@Column(name = "d_time")
	private Date time;
	
	/**
	 * 是有可用
	 */
	@Column(name = "s_use")
	private String use;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getServer() {
		return server;
	}

	public void setServer(String server) {
		this.server = server;
	}

	public String getBlack() {
		return black;
	}

	public void setBlack(String black) {
		this.black = black;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getUse() {
		return use;
	}

	public void setUse(String use) {
		this.use = use;
	}

	@Override
	public void from(ProxyBlackEntity t) {
		BeanUtils.copyProperties(t, this);
		
	}

	@Override
	public ProxyBlackEntity toEntity() {
		ProxyBlackEntity toEntity = new ProxyBlackEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}
}
